﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TTServer
{
    public partial class FormSetAdminPassword : Form
    {
        private FormSetAdminPassword()
        {
            InitializeComponent();
        }

        private FormTTServerGUI formTTServerGUI;

        public FormSetAdminPassword(FormTTServerGUI form)
        {
            InitializeComponent();

            this.formTTServerGUI = form;
        }

        private void btnApplyNewAdminPassword_Click(object sender, EventArgs e)
        {
            try
            {
                String password = txtAdminstratorPassword.Text;

                formTTServerGUI.SetAdministratorPassword(password);

                MessageBox.Show("The administrator has been changed.", "Notice");

                this.Close();
            }
            catch
            {
                MessageBox.Show("Your password is invalid. Please try another", "Notice");
            }
        }
    }
}
